package cn.accp.kzy.service;

import cn.accp.kzy.dao.BBSUserDao;
import cn.accp.kzy.dao.impl.BBSUserDaoImpl;
import cn.accp.kzy.model.BBSUser;

public class BBSUserManager {
	private BBSUserDao userDaoImpl = new BBSUserDaoImpl();
	public void	addUser(BBSUser user) {
		userDaoImpl.addUser(user);
	}
	public BBSUser getBBSUserByUid(int uid) {
		BBSUser user=userDaoImpl.getBBSUserByUid(uid);
		return user;
	}
	public BBSUser login(String name, String password) {
		BBSUser user = userDaoImpl.getBBSUserByUsername(name);
		if(user!= null && user.getUpassword().equals(password)) {
			return user;
		}
		return null;
	}
	public int getAllUserCount() {
		return userDaoImpl.getAllUserCount();
	}
	public void updateUserPoint(int uid, int point) {
		userDaoImpl.updateUserPoint(uid, point);
	}
}
